@extends('layouts.admin')
@push('morecss')
    <!-- jsTree -->
    {{--<link href="{{ asset('/vendor/jstree/dist/themes/default/style.min.css') }}" rel="stylesheet">--}}
    <!--ztree-->
    <link rel="stylesheet" href="{{ asset('/vendor/ztree_v3/css/zTreeStyle/zTreeStyle.css') }}" type="text/css">
@endpush

@push('morescript')
    <!-- jsTree -->
    {{--<script src="{{ asset('/vendor/jstree/dist/jstree.min.js') }}"></script>--}}
    <!--ztree-->
    <script type="text/javascript" src="{{ asset('/vendor/ztree_v3/js/jquery.ztree.core.js') }}"></script>
    <script type="text/javascript" src="{{ asset('/vendor/ztree_v3/js/jquery.ztree.excheck.js') }}"></script>
    <script type="text/javascript" src="{{ asset('/vendor/ztree_v3/js/jquery.ztree.exedit.js') }}"></script>
    <script type="application/javascript">
        let page_params = {
            @can('admin.wxuser.index')
            url_list : '{{ route('admin.wxuser.index') }}',
            @endcan
            @can('admin.wxuser.setremark')
            url_setremark : '{{ route('admin.wxuser.setremark') }}',
            @endcan
            @can('admin.wxuser.addtag')
            url_addtag : '{{ route('admin.wxuser.addtag') }}',
            @endcan
            @can('admin.wxuser.settag')
            url_settag : '{{ route('admin.wxuser.settag') }}',
            @endcan
            @can('admin.wxuser.setblack')
            url_setblack : '{{ route('admin.wxuser.setblack') }}',
            @endcan
            @can('admin.wxuser.sync')
            url_sync : '{{ route('admin.wxuser.sync') }}',
            @endcan
            @can('admin.wxuser.syncblack')
            url_syncblack : '{{ route('admin.wxuser.syncblack') }}',
            @endcan
            data_tag : @json($tagList),
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/wxuser_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="subscribe_scene">关注渠道</label>
                        <select class="form-control input-s-sm inline" name="subscribe_scene" id="subscribe_scene">
                            <option value="">请选择</option>
                            @foreach($subscribeSceneList as $key => $val)
                            <option value="{{ $key }}">{{ $val }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="form-group">
                        <label class="control-label" for="openid">openid</label>
                        <input type="text" id="openid" name="openid" value="" placeholder="用户openid"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="form-group">
                        <label class="control-label" for="keyword">关键字</label>
                        <input type="text" id="keyword" name="keyword" value="" placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="sex">性别</label>
                        <select class="form-control input-s-sm inline" name="sex" id="sex">
                            <option value="-1">请选择</option>
                            <option value="0">未知</option>
                            <option value="1">男性</option>
                            <option value="2">女性</option>
                        </select>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" id="btn-search"><i class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-lg-6" style="width: 450px;">
            @can('admin.wxuser.addtag')
                <button class="btn btn-primary" id="btn-addtag"><i class="fa fa-tag"></i> 打标签</button>
            @endcan
            @can('admin.wxuser.setblack')
                <button class="btn btn-primary" id="btn-addblack"><i class="fa fa-lock"></i> 加入黑名单</button>
            @endcan
            @can('admin.wxuser.sync')
                <button class="btn btn-primary" id="btn-sync"><i class="fa fa-refresh"></i> 同步用户</button>
            @endcan
            @can('admin.wxuser.syncblack')
                <button class="btn btn-primary" id="btn-syncblack"><i class="fa fa-refresh"></i> 同步黑名单</button>
            @endcan
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 设置备注 -->
    <div class="ibox-content" id="box-remark" style="display: none">
        <form class="form-horizontal m-t" method="post" action="">
            <input type="hidden" name="openid" id="openid"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注名称：</label>
                <div class="input-group col-sm-7">
                    <input id="remark" type="text" class="form-control" name="remark" aria-required="true">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">提交</button>
                </div>
            </div>
        </form>
    </div>
    <!-- 设置备注 -->

    <!-- 设置标签 -->
    <div class="ibox-content" id="box-tag" style="display: none">
        <form method="POST" class="form-horizontal">
            <input type="hidden" name="openids" id="openids"/>
            <div class="form-group">
                <div id="treeTag" class="ztree"></div>
            </div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">提交</button>
                </div>
            </div>
        </form>
    </div>
    <!-- 设置标签 -->
@endsection